import request from '@/utils/request'
const module="/admin/system/user";

export const selectUsers = (pageNum,pageSize,sysUserSearchDto) => {
    return request({
      url: `${module}/list/${pageNum}/${pageSize}`,
      method: 'get',
      params:sysUserSearchDto
    })
  }

  export const addUser = (sysUser) => {
    return request({
      url: `${module}/add`,
      method: 'post',
      data:sysUser
    })
  }

  export const deleteUser = (id) => {
    return request({
      url: `${module}/delete/${id}`,
      method: 'delete',
    })
  }
  export const updateUser = (sysUser) => {
    return request({
      url: `${module}/update`,
      method: 'put',
      data:sysUser
    })
  }

  export const assignRoles2User=(userId,roleIds)=>{
    return request({
      url:`/admin/system/userRole/assignRole2User/${userId}`,
      method: 'put',
      data:roleIds
    }
    )
  }
